home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 March / Ahoy_Magazine_86-03_1986_Double_L.d64 / rooting routine (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  179b  |  9 lines

  1. 10 rem  problem #23-2 :
  2. 20 rem    rooting routine
  3. 30 rem  solution by dick eigenraam
  4. 40 rem
  5. 50 input n : g=1
  6. 60 if g*g<n then g=g+1 : goto 60
  7. 70 g=g-1 : if (g+.5)*(g+.5)<n then g=g+1
  8. 80 print g
  9.